﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Ficha_Agenda.ascx.cs"
    Inherits="HRP.Private.Funcionarios.Controlos.Ficha_Agenda" %>
<!-- FALTAS -->
<asp:UpdatePanel runat="server" ID="faltasFuncPanel" ChildrenAsTriggers="true" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="user-profile-content">
            <br />
            <div class="row">
                <div class="col-sm-8">
                    <h5>
                        <strong>Faltas</strong></h5>
                    <div class="additional-btn">
                        <a class="additional-icon" href="#" data-toggle="collapse" data-target="#faltasDiv">
                            <i class="fa fa-chevron-down"></i></a>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="toolbar-btn-action">
                        <a class="btn btn-success md-trigger marginRight5" href="Faltas/Criar.aspx?funcId=<%=NumFuncionario%>">
                            Registar Nova Falta <i class="fa fa-plus-circle"></i></a>
                    </div>
                </div>
                <div id="faltasDiv" class="col-sm-12 collapse">
                    <%if (faltasTable.Items.Count == 0)
                      { %>
                    <p class="text-muted">
                        Não tem histórico de faltas.</p>
                    <%}
                      else
                      { %>
                    <asp:Repeater runat="server" ID="faltasTable">
                        <HeaderTemplate>
                            <div class="table-responsive">
                                <table class="table table-hover table-striped">
                                    <thead>
                                        <tr>
                                            <th style="width: 30px" data-sortable="false">
                                                <input type="checkbox" class="rows-check">
                                            </th>
                                            <th>
                                                Data
                                            </th>
                                            <th>
                                                Dia Completo
                                            </th>
                                            <th>
                                                Justificada
                                            </th>
                                            <th>
                                                Observação
                                            </th>
                                            <th>
                                                Activa
                                            </th>
                                            <th data-sortable="false">
                                                Opção
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <input type="checkbox" class="rows-check">
                                </td>
                                <td>
                                    <%#
        ((DateTime)Eval("data_inicio")).ToString(HRP.Utilidades.DefinicoesSite.DataFormato) %>
                                </td>
                                <td>
                                    <%# ((bool)Eval("dia_completo"))
        ? "Sim":"Não"%>
                                </td>
                                <td>
                                    <%# ((bool)Eval("falta_justificada")) ? "Sim":"Não"%>
                                </td>
                                <td>
                                    <%# Eval("obs").ToString()%>
                                </td>
                                <td>
                                    <span class="label <%#(bool)Eval("activo")
        ? "label-success" : "label-danger"%> ">
                                        <%#(bool)Eval("activo") ? "Sim" : "Não"%></span>
                                </td>
                                <td>
                                    <div class="btn-group btn-group-xs">
                                        <asp:LinkButton ID="activarDesButton" data-toggle="tooltip" ToolTip='<%#(bool)Eval("activo") ? "Desactivar" : "Activar"%>'
                                            CssClass="btn btn-default" runat="server" CommandName="F" CommandArgument='<%#Eval("id")
        %>' OnCommand="alterarEstadoFunc"><i class="fa fa-power-off"></i></asp:LinkButton>
                                        <a href='Faltas/Editar.aspx?id=<%#Eval("id") %>&funcId=<%#Eval("id_funcionario")%>'
                                            data-toggle="tooltip" title="Editar" class="btn btn-default"><i class="fa fa-edit">
                                            </i></a>
                                        <asp:LinkButton ID="downloadFalta" data-toggle="tooltip" ToolTip="Ver Justificativo"
                                            CssClass="btn btn-default" Style='<%#string.IsNullOrEmpty(((string)Eval("comprovativo")))
        ? "display:none;": "" %>' runat="server" CommandArgument='<%#Eval("comprovativo")
        %>' OnCommand="downloadFaltaFunc"><i class="fa fa-download"></i></asp:LinkButton>
                                    </div>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </tbody></table></div></FooterTemplate>
                    </asp:Repeater>
                    <%} %>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
<hr />
<!-- Horas Extra -->
<asp:UpdatePanel runat="server" ID="horasExtraUP" ChildrenAsTriggers="true" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="user-profile-content">
            <br />
            <div class="row">
                <div class="col-sm-8">
                    <h5>
                        <strong>Horas Extras</strong></h5>
                                            <div class="additional-btn">
                        <a class="additional-icon" href="#" data-toggle="collapse" data-target="#horasExtrasDiv">
                            <i class="fa fa-chevron-down"></i></a>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="toolbar-btn-action">
                        <a class="btn btn-success md-trigger marginRight5" href="HorasExtras/Criar.aspx?funcId=<%=NumFuncionario%>">
                            Registar Horas Extras <i class="fa fa-plus-circle"></i></a>
                    </div>
                </div>
                <div class="col-sm-12 collapse" id="horasExtrasDiv">
                    <%if (horasExtrasTable.Items.Count == 0)
                      { %>
                    <p class="text-muted">
                        Não tem horas extras registadas.</p>
                    <%}
                      else
                      { %>
                    <asp:Repeater runat="server" ID="horasExtrasTable">
                        <HeaderTemplate>
                            <div class="table-responsive">
                                <table class="table table-hover table-striped">
                                    <thead>
                                        <tr>
                                            <th style="width: 30px" data-sortable="false">
                                                <input type="checkbox" class="rows-check">
                                            </th>
                                            <th>
                                                Data
                                            </th>
                                            <th>
                                                Número Horas
                                            </th>
                                            <th>
                                                Valor
                                            </th>
                                            <th>
                                                Observação
                                            </th>
                                            <th>
                                                Activa
                                            </th>
                                            <th data-sortable="false">
                                                Opção
                                            </th>
                                        </tr>
                                    </thead>
                                    <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <input type="checkbox" class="rows-check">
                                </td>
                                <td>
                                    <%# ((DateTime)Eval("data_inicio")).ToString(HRP.Utilidades.DefinicoesSite.DataFormato) %>
                                </td>
                                <td>
                                    <%# Eval("numeroHoras").ToString()%>
                                </td>
                                <td>
                                    <%# ((double)Eval("valor") * 100).ToString() + " %"%>
                                </td>
                                <td>
                                    <%# Eval("obs").ToString()%>
                                </td>
                                <td>
                                    <span class="label <%#(bool)Eval("activo") ? "label-success" : "label-danger"%> ">
                                        <%#(bool)Eval("activo") ? "Sim" : "Não"%></span>
                                </td>
                                <td>
                                    <div class="btn-group btn-group-xs">
                                        <asp:LinkButton ID="activarDesButton" data-toggle="tooltip" ToolTip='<%#(bool)Eval("activo") ? "Desactivar" : "Activar"%>'
                                            CssClass="btn btn-default" runat="server" CommandName="HE" CommandArgument='<%#Eval("id") %>'
                                            OnCommand="alterarEstadoFunc"><i class="fa fa-power-off"></i></asp:LinkButton>
                                        <a href='HorasExtras/Editar.aspx?id=<%#Eval("id") %>&funcId=<%#Eval("id_funcionario")%>'
                                            data-toggle="tooltip" title="Editar" class="btn btn-default"><i class="fa fa-edit">
                                            </i></a>
                                    </div>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </tbody></table></div></FooterTemplate>
                    </asp:Repeater>
                    <%} %>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
